org.eclipse.vtp.desktop.projects.core.internals
Class ApplicationFragment

java.lang.Object
  extended by org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
      extended by org.eclipse.vtp.desktop.projects.core.internals.ApplicationFragment
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IApplicationFragment, ObjectListener, IVoiceToolsResource

public class ApplicationFragment
extends VoiceResource
implements IApplicationFragment


Constructor Summary
ApplicationFragment(org.eclipse.core.resources.IFile file, ApplicationFragmentProject project)
          Creates a new ApplicationDesign with the given file resource and parent project.
 
Method Summary
 java.lang.String getFragmentId()
           
 java.lang.String getName()
           
protected  java.lang.String getObjectId()
          The object id is used by the event system to uniquely identify a project resource.
 IVoiceToolsResource getParent()
          Returns the parent of this resource.
 IVoiceToolsProject getProject()
          Returns the top level project object that contains this resource.
 org.eclipse.core.resources.IFile getUnderlyingFile()
           
 java.io.InputStream read()
          Opens the application definition resource and returns an InputStream that will produce the byte contents of the resource.
 void write(java.io.InputStream in)
          Requests the contents of the application definition resource be replaced with the contents of the given input stream.
 
Methods inherited from class org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
addRefreshListener, deferEvents, finalize, getAdapter, processObjectEvent, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.vtp.desktop.projects.core.IVoiceToolsResource
addRefreshListener, deferEvents, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

ApplicationFragment

public ApplicationFragment(org.eclipse.core.resources.IFile file,
                           ApplicationFragmentProject project)
Creates a new ApplicationDesign with the given file resource and parent project.

Parameters:
file - The eclipse file resource this represents
project - The application project that contains this design
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface IVoiceToolsResource
Returns:
The name of the resource

getProject

public IVoiceToolsProject getProject()
Description copied from interface: IVoiceToolsResource
Returns the top level project object that contains this resource.

Specified by:
getProject in interface IVoiceToolsResource
Overrides:
getProject in class VoiceResource
Returns:
The containing project

getUnderlyingFile

public org.eclipse.core.resources.IFile getUnderlyingFile()
Specified by:
getUnderlyingFile in interface IApplicationFragment

read

public java.io.InputStream read()
                         throws org.eclipse.core.runtime.CoreException
Description copied from interface: IApplicationFragment
Opens the application definition resource and returns an InputStream that will produce the byte contents of the resource.

Specified by:
read in interface IApplicationFragment
Returns:
An input stream to the contents of the resource
Throws:
org.eclipse.core.runtime.CoreException - If an error occurs while opening the resource

write

public void write(java.io.InputStream in)
           throws org.eclipse.core.runtime.CoreException
Description copied from interface: IApplicationFragment
Requests the contents of the application definition resource be replaced with the contents of the given input stream.

Specified by:
write in interface IApplicationFragment
Parameters:
in - An input stream to the new contents of the definition resource
Throws:
org.eclipse.core.runtime.CoreException - If and error occurs while storing the new definition contents

getParent

public IVoiceToolsResource getParent()
Description copied from interface: IVoiceToolsResource
Returns the parent of this resource. If this is a project resource this function returns this.

Specified by:
getParent in interface IVoiceToolsResource
Returns:
The parent of this resource resource

getObjectId

protected java.lang.String getObjectId()
Description copied from class: VoiceResource
The object id is used by the event system to uniquely identify a project resource. In this fashion, multiple references to the resource can be created and still be notified of events.

Specified by:
getObjectId in class VoiceResource
Returns:
A unique identifier for this resource

getFragmentId

public java.lang.String getFragmentId()
Specified by:
getFragmentId in interface IApplicationFragment